package com.fs.uc.core.relationship;

import com.fs.uc.core.SubjectType;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

/**
 * @author 崔超
 * 2022/1/7
 */
@ApplicationScoped
public class RelationFetcherFactory {
    @Inject
    PersonRelationFetcher personRelationFetcher;
    @Inject
    OrgRelationFetcher orgRelationFetcher;

    public IRelationFetcher fetcher(SubjectType type) {
        if (type == SubjectType.Person) {
            return personRelationFetcher;
        } else {
            return orgRelationFetcher;
        }
    }
}
